import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Echarts from '@/views/Echarts.vue'
import PromotionsView from '@/views/PromotionsView.vue'
import UserManage from '@/views/UserManage.vue'
import FrumManage from '@/views/FrumManage.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login,
    meta: {
      showIf: true
    }
  },
  {
    path: '/echarts',
    name: 'echarts',
    component: Echarts,
  },
  {
    path: '/promotions',
    name: 'promotions',
    component: PromotionsView,
  },
  {
    path: '/users',
    name: 'users',
    component: UserManage,
  },
  {
    path: '/frum',
    name: 'frum',
    component: FrumManage,
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
